<?php
session_start ();

$level = 1;
$answer = "go back and give me an answer~~";

if (isset ( $_SESSION ['level'] )) {
	$level = $_SESSION ['level'];
}

if (isset ( $_POST ['answer'] )) {
	$answer = $_POST ['answer'];
}

switch ($level) {
	case 1 :
		//q1, wus the name of the bear
		if (md5 ( $answer ) === "3caadc6141f216602de003125f885abd") {
			$_SESSION ['level'] = 2;
		}
		break;
	case 2 :
		//q2, wus congcong street num
		if (md5 ( $answer ) === "812b4ba287f5ee0bc9d43bbf5bbe87fb") {
			$_SESSION ['level'] = 3;
		}
		break;
	case 3 :
		//q3, xu xiao hao is ?
		if (md5 ( $answer ) === "1af93cd259ad7ac7f4e28e1a79e79164") {
			$_SESSION ['level'] = 4;
		}
		break;
	default :
		header ( "Location:panel.php" );
}

header ( "Location:panel.php" );